#ifndef _JPHYSICSMATHS_H_
#define _JPHYSICSMATHS_H_

#define PI 3.141592654f
#define EPSILON 1.0E-6f

#include <math.h>
/*
struct JPVector3
{
	JPVector3 (float newX=0.0f, float newY=0.0f, float newZ=0.0f) : x(newX), y(newY), z(newZ) {}

	// overload + operator
	JPVector3 operator+(const JPVector3 &vector) const {return JPVector3(vector.x+x, vector.y+y, vector.z+z);}
	// overload - operator
	JPVector3 operator-(const JPVector3 &vector) const {return JPVector3(x-vector.x, y-vector.y, z-vector.z);}
	// overload * operator
	JPVector3 operator*(float number) const	 {return JPVector3(x*number, y*number, z*number);}
	// overload / operator
	JPVector3 operator/(float number) const	 {return JPVector3(x/number, y/number, z/number);}
	// overload /  vector operator
	JPVector3 operator/(const JPVector3 &vector) const {return JPVector3(x/vector.x, y/vector.y, z/vector.z);}

	float x, y, z;						// 3D vector coordinates
};

struct JPQuaternion
{
	float x, y, z, w;
};

struct JPMatrix
{
	JPMatrix() {}
	JPMatrix (float a00, float a01, float a02,
		float a10, float a11, float a12,
		float a20, float a21, float a22)
	{ 
		address[0][0] = a00; address[0][1] = a01; address[0][2] = a02;
		address[1][0] = a10; address[1][1] = a11; address[1][2] = a12;
		address[2][0] = a20; address[2][1] = a21; address[2][2] = a22;
	}
	JPMatrix operator*(float number)
	{
		return JPMatrix(address[0][0] * number, address[0][1] * number, address[0][2] * number,
			address[1][0] * number, address[1][1] * number, address[1][2] * number,
			address[2][0] * number, address[2][1] * number, address[2][2] * number);
	}
	JPMatrix operator/(float number)
	{
		return JPMatrix(address[0][0] / number, address[0][1] / number, address[0][2] / number,
			address[1][0] / number, address[1][1] / number, address[1][2] / number,
			address[2][0] / number, address[2][1] / number, address[2][2] / number);
	}

	JPVector3 operator*(JPVector3 v)
	{
		return JPVector3(address[0][0]* v.x + address[0][1]* v.y + address[0][2]* v.z,
			address[1][0]* v.x + address[1][1]* v.y + address[1][2]* v.z,
			address[2][0]* v.x + address[2][1]* v.y + address[2][2]* v.z);
	}

	JPMatrix operator*(JPMatrix m)
	{
		return JPMatrix(address[0][0]*m.address[0][0] + address[0][1]*m.address[1][0] + address[0][2]*m.address[2][0],
			address[0][0]*m.address[0][1] + address[0][1]*m.address[1][1] + address[0][2]*m.address[2][1],
			address[0][0]*m.address[0][2] + address[0][1]*m.address[1][2] + address[0][2]*m.address[2][2],

			address[1][0]*m.address[0][0] + address[1][1]*m.address[1][0] + address[1][2]*m.address[2][0],
			address[1][0]*m.address[0][1] + address[1][1]*m.address[1][1] + address[1][2]*m.address[2][1],
			address[1][0]*m.address[0][2] + address[1][1]*m.address[1][2] + address[1][2]*m.address[2][2],

			address[2][0]*m.address[0][0] + address[2][1]*m.address[1][0] + address[2][2]*m.address[2][0],
			address[2][0]*m.address[0][1] + address[2][1]*m.address[1][1] + address[2][2]*m.address[2][1],
			address[2][0]*m.address[0][2] + address[2][1]*m.address[1][2] + address[2][2]*m.address[2][2]);
	}

	JPVector3 column (int column) const { return JPVector3(address[0][column], address[1][column], address[2][column]); }
	JPVector3 row    (int row)    const { return JPVector3(address[row][0], address[row][1], address[row][2]); }

	float address[3][3];
};

class JPMaths
{
public:
	JPMaths(){};
	~JPMaths(){};


	// Vector Maths
	static float		dotProduct(const JPVector3 &vector1, const JPVector3 &vector2);
	static JPVector3	crossProduct(const JPVector3 &v1, const JPVector3 &v2);
	static float		calcMagnitude(const JPVector3 &vector);
	static JPVector3	unitVector(const JPVector3 &vector);

	// Quaternion functions
	static float		length(const JPQuaternion &quat);
	static JPQuaternion normalise(const JPQuaternion &quat);
	static JPQuaternion conjugate(const JPQuaternion &quat);
	static JPQuaternion multiply(const JPQuaternion &A, const JPQuaternion &B);
	static JPQuaternion vecToQuat(const JPVector3 &vec);
	static JPVector3	quatRotation(const JPVector3 &vector, const JPVector3 &axis, float angle);

	// 3X3 Matrix functions
	static float	determinant(const JPMatrix &m);
	static JPMatrix invertMatrix(const JPMatrix &m);

protected:

};
*/
#endif // _JPHYSICSMATHS_H_